﻿
/*----------------------------------------------------------------
 * 创建时间：2023/9/5 16:46:17
 * 作  者：wenlli 
 * 项  目：Minotaur.App.Domains.ViewModel.Logs 
 * 描  述：
 *
 * ----------------------------------------------------------------
 * 修改人：
 * 时  间：
 * 修改说明：
 * 
 *----------------------------------------------------------------*/


using Prism.Commands;
using Prism.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;

namespace Minotaur.App.Domains.ViewModel.Logs
{
    public class SystemLogListViewModel : BindableBase
    {
        public virtual long AutoId { get; set; }
        public virtual string? TCnname { get; set; }
        public virtual string? Code { get; set; }
        public virtual string? Account { get; set; }
        private int _LogType;
        public virtual int LogType
        {
            get => _LogType;
            set
            {
                _LogType = value;
                switch (value)
                {
                    case 0:
                        {
                            RowColor = "#f56c6c";
                            ForeRowColor = "#f56c6c";
                        }
                        break;
                    case 1:
                        {
                            RowColor = "#e6a23c";
                            ForeRowColor = "#e6a23c";
                        }
                        break;
                    case 2:
                        {
                            RowColor = "#108ee9";
                            ForeRowColor = "Snow";
                        }
                        break;
                    default:
                        {
                            RowColor = "#108ee9";
                            ForeRowColor = "Snow";
                        }
                        break;
                }
            }
        }
        public virtual string? CNName { get; set; }
        public virtual string ExecuteDate { get; set; }
        public virtual string? ExecuteMethod { get; set; }
        public virtual string ExecuteCompletiontime { get; set; }
        public virtual string? RequestParamtetr { get; set; }
        public virtual string? ExecuteResult { get; set; }
        public virtual string? UserAgent { get; set; }

        /// <summary>
        /// 详情按钮
        /// </summary>
        [Newtonsoft.Json.JsonIgnore()]
        public Action<object?> DetaileAction { get; set; }

        /// <summary>
        /// 行颜色
        /// </summary>
        public string RowColor { get; set; }

        /// <summary>
        /// 字体颜色
        /// </summary>
        public string ForeRowColor { get; set; }

        /// <summary>
        /// 详情按钮
        /// </summary>
        [Newtonsoft.Json.JsonIgnore()]
        public ICommand DetaileCommand => new DelegateCommand<object?>(DetaileAction);


    }
}
